package org.finalministry.database.dao;


public class DaoFactory {

	// private static DaoFactory daoFactory;
	// private static FinalministryDatabaseConnection finalMinistryConnection;
	// private IDatabaseConnection connection;
	// private ContactDAO contactDAO;
	// private AddressDAO addressDAO;
	// private CountryDAO countryDAO;
	// private PreacherDAO preacherDAO;
	// private CongregationDAO congregationDAO;
	// private AreaDAO areaDAO;
	// private NeutralPointDAO neutralPointDAO;
	// private FlagsTagsNotesDAO flagsTagsNotesDAO;
	// private TerritoryDAO territoryDAO;
	// private OsmDAO osmDAO;
	// private DeveloperDAO developerDAO;
	//
	// protected DaoFactory(IDatabaseConnection connection) throws
	// ClassNotFoundException, SQLException {
	//
	// this.connection = connection;
	//
	// contactDAO = new ContactDAO(this.connection);
	// addressDAO = new AddressDAO(this.connection);
	// countryDAO = new CountryDAO(this.connection);
	// preacherDAO = new PreacherDAO(this.connection);
	// congregationDAO = new CongregationDAO(this.connection);
	// areaDAO = new AreaDAO(this.connection);
	// neutralPointDAO = new NeutralPointDAO(this.connection);
	// flagsTagsNotesDAO = new FlagsTagsNotesDAO(this.connection);
	// territoryDAO = new TerritoryDAO(this.connection);
	// osmDAO = new OsmDAO(this.connection);
	// developerDAO = new DeveloperDAO(this.connection);
	// }
	//
	// public static DaoFactory getInstance() throws ClassNotFoundException,
	// SQLException {
	//
	// if (daoFactory == null) {
	// System.out.println("DaoFactory is null. I will create a new one.");
	// daoFactory = new DaoFactory(getFinalMinistryConnection());
	// }
	//
	// return daoFactory;
	// }
	//
	// public ContactDAO getContactDAO() {
	// return contactDAO;
	// }
	//
	// public AddressDAO getAddressDAO() {
	// return addressDAO;
	// }
	//
	// public CountryDAO getCountryDAO() {
	// return countryDAO;
	// }
	//
	// public PreacherDAO getPreacherDAO() {
	// return preacherDAO;
	// }
	//
	// public CongregationDAO getCongregationDAO() {
	// return congregationDAO;
	// }
	//
	// public AreaDAO getAreaDAO() {
	// return areaDAO;
	// }
	//
	// public NeutralPointDAO getNeutralPointDAO() {
	// return neutralPointDAO;
	// }
	//
	// public FlagsTagsNotesDAO getFlagsTagsNotesDAO() {
	// return flagsTagsNotesDAO;
	// }
	//
	// public TerritoryDAO getTerritoryDAO() {
	// return territoryDAO;
	// }
	//
	// public void closeConnection() throws SQLException {
	// if (connection != null) {
	// connection.closeConnection();
	// }
	// }
	//
	// public boolean isConnectionActive() {
	// try {
	// return connection.isConnectionActive();
	// } catch (SQLException e) {
	// System.out.println("You've tested if the database is still active. It seems to be inactive at least.");
	//
	// return false;
	// }
	// }
	//
	// /**
	// * Set the congregationID to all DAO's.
	// *
	// * @param congregationID
	// */
	// public void setCongregationID(Long congregationID) {
	//
	// contactDAO.setCongregationID(congregationID);
	// }
	//
	// public Long getCongregationID() {
	//
	// return contactDAO.getCongregationID();
	// }
	//
	// public static FinalministryDatabaseConnection
	// getFinalMinistryConnection() {
	// return finalMinistryConnection;
	// }
	//
	// /**
	// * Set the connection and initialize the database if necessary
	// *
	// * @param finalMinistryConnection
	// * @throws SQLException
	// * @throws ClassNotFoundException
	// * @throws IOException
	// */
	// public static void
	// setFinalMinistryConnection(FinalministryDatabaseConnection
	// finalMinistryConnection) throws SQLException,
	// ClassNotFoundException, IOException {
	//
	// DaoFactory.finalMinistryConnection = finalMinistryConnection;
	// DatabaseInitializer.initialize(finalMinistryConnection);
	// }
	//
	// public OsmDAO getOsmDAO() {
	// return osmDAO;
	// }
	//
	// public DeveloperDAO getDeveloperDAO() {
	// return developerDAO;
	// }

}
